#ifndef ANTISTRESS_H
#define ANTISTRESS_H

#include <QtGui/QMainWindow>
#include "ui_antistress.h"
#include "src/home.h"
#include "src/pause.h"
#include "src/work.h"
#include "src/settings.h"
#include "QTimer"
#include "neuralnetwork.h"

#include "OakSensorVisual.h"
class Antistress : public QMainWindow
{
    Q_OBJECT

public:
    Antistress(QWidget *parent = 0);
    ~Antistress();

private:
	enum PauseStateEnum {
		ANY,
		INITIALIZE,
		DOWN,
		MID,
		HIGH
	};

    Ui::antistressClass ui;
    Home *m_home;
    Pause *m_pause;
    Work *m_work;
    Settings *m_settings;

    int freqPauseH;
    int freqPauseMin;
	int freqPauseSec;
    int lengthPause;
	int lengthSecPause;
    int sec;

	int m_cycle;
	PauseStateEnum m_state;
	NeuralNetwork m_network;
	OakSensorVisual *m_usbsensor; 

	void loadNetworkFile(QString _file);
	void resetCentralWidget();
public:
    QTimer *workTimer;
    QTimer *pauseTimer;
    QTimer *refreshTimer;
	QTimer *m_neuralTimer;

signals:
    void refresh(int);

public slots:
	void exit();
	void selectPauseWidget();
	void selectSettingsWidget();
	void selectWorkWidget();
	void selectHomeWidget();
        void updateSettings();
        void workEnd();
        void pauseEnd();
		void refreshWP();

		void runningNeuralNetwork();

};

#endif // ANTISTRESS_H
